@import './../../../styles/_components.scss';

app-nav-menu {
  display: block;
  margin: 0 auto;
  font-size: 13px;
  ul,
  a {
    padding: 0;
    margin: 0;
  }

  &:first-child {
    margin-top: $unit * 2;
  }

  app-nav-item div a {
    padding-left: $unit * 2;
  }
}

.nav-menu-item {
  box-sizing: border-box;
  cursor: pointer;
  display: block;
  max-width: 260px;
  overflow-wrap: break-word;
  padding-top: $unit / 2;
  padding-bottom: $unit / 2;
  padding-left: $unit * 2;
  text-decoration: none;
  text-align: left;
  transition-duration: 180ms;
  transition-property: background-color, color;
  transition-timing-function: ease-in-out;
  width: 100%;
  word-wrap: break-word;
  outline: none;
  transition: all 300ms ease-in-out;

  //icons _within_ nav
  .mat-icon {
    position: absolute;
    top: 0;
    right: $unit;
    margin: $unit / 2;
  }
}

button.nav-menu-item {
  border: none;
  background-color: transparent;
  padding: $unit 0 $unit $unit * 2;
}

.heading {
  cursor: pointer;
  position: relative;
  text-transform: uppercase;
  width: 100%;
}

.heading.expanded > .rotating-icon {
  @include rotate(0deg);
}

.heading.collapsed > .rotating-icon {
  @include rotate(-90deg);
  margin: $unit / 2;
}

.heading-children.expanded {
  visibility: visible;
  opacity: 1;
  max-height: 4000px; // Arbitrary max-height. Can increase if needed. Must have measurement to transition height.
  transition: visibility 500ms, opacity 500ms, max-height 500ms;
  -webkit-transition-timing-function: ease-in-out;
  transition-timing-function: ease-in-out;
}

.heading-children.collapsed {
  visibility: hidden;
  opacity: 0;
  max-height: 1px; // Must have measurement to transition height.
  transition: visibility 275ms, opacity 275ms, max-height 280ms;
  -webkit-transition-timing-function: ease-out;
  transition-timing-function: ease-out;
}

.level-1 {
  font-family: $main-font;
  font-size: 14px;
  font-weight: 400;
  padding-left: $unit * 2;
  transition: background-color 200ms;
  text-transform: uppercase;
}

.level-2 {
  font-family: $main-font;
  font-size: 14px;
  font-weight: 400;
  padding-left: $unit * 2;
  text-transform: none;
}

.level-3 {
  font-family: $main-font;
  font-size: 14px;
  padding-left: $unit;
}
